import React from 'react';
import {Button, Card, notification} from 'antd';


export default class Notice extends React.Component {

  openNotification(type, duration) {
    notification[type]({
      message: type+'通知',
      description: '通知内容通知内容',
      placement: duration,
      duration: 2
    })
  }

  render() {
    return (
      <div className="">
        <Card title="notification">
          <Button type="primary" onClick={() => this.openNotification('success', 'topLeft')}>success</Button>
          <Button type="primary" onClick={() => this.openNotification('error', 'bottomLeft')}>error</Button>
          <Button type="primary" onClick={() => this.openNotification('info', 'topRight')}>info</Button>
          <Button type="primary" onClick={() => this.openNotification('warning', 'bottomRight')}>warning</Button>
        </Card>
      </div>
    );
  }
}